package com.wjh.controller;


import com.wjh.service.ComplaintService;
import com.wjh.utils.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("complaint")
public class ComplaintController {

    @Resource
    private ComplaintService complaintService;

    @GetMapping("/list")
    public ResponseResult getComplaintAll(Integer pageNum,Integer pageSize,String phone,
                                                            String complaintName, Integer state){
        return complaintService.getComplaintAll(pageNum,pageSize,phone,complaintName,state);
    }


    @PutMapping("/update/state")
    public ResponseResult updateComplaintState(Integer id,Integer state){
        return complaintService.updateComplaintState(id,state);
    }


}
